-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: config route with management fileds (E2E) #927
test: config route with management fileds (E2E) #927
Conversation
func TestRoute_with_name_desc(t *testing.T) { | ||
tests := []HttpTestCase{ | ||
{ | ||
caseDesc: "config route with name and desc (r1)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the first letter lowercase of caseDesc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's unreasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I see, we can fix it in 2.2
, what do you think? @nic-chen
"name": "jack", | ||
"create_time": 1604046556, | ||
"update_time": 1604046556, | ||
"desc": "config route with name and desc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad desc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just used to compare the case results, so it's good as long as it does not exist before.
Sleep: sleepTime, | ||
}, | ||
{ | ||
caseDesc: "verify the route's detail (r1)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this test case different from the first one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case is to verify that input create_time
, update_time
can also create routes.
respBody, _ := ioutil.ReadAll(resp.Body) | ||
createtime := gjson.Get(string(respBody), "data.create_time") | ||
updatetime := gjson.Get(string(respBody), "data.update_time") | ||
assert.NotEqual(t, createtime.String(), "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not compare the time here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, the timestamp should also be compared here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @moonming Can you review it when you have time?
Body: `{ | ||
"uri": "/hello", | ||
"name": "jack", | ||
"create_time": 1604046556, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should forbidden to specify create_time
, update_time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if manager-api wants to support the command line to create routes in the future, it probably should not be forbidden to specify create_time
, update_time
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create_time
and update_time
are fields maintained by manager-api, and we do not need the caller to care about them.
so I think we can delete create_time
and update_time
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a new issue, we can it later: #933
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I delete that part.
Codecov Report
@@ Coverage Diff @@
## master #927 +/- ##
==========================================
+ Coverage 42.82% 43.10% +0.27%
==========================================
Files 18 18
Lines 1289 1290 +1
==========================================
+ Hits 552 556 +4
+ Misses 645 642 -3
Partials 92 92
Continue to review full report at Codecov.
|
…route (r1) before other test.
@idbeta your branch is wrong, we can close this PR then you can submit a new one |
Please answer these questions before submitting a pull request
Why submit this pull request?
E2E test
New feature provided
Improve performance
Related issues
resolve add e2e test for config route with management fileds #638